import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase21='DBshop021_添加品牌流程'
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','商品品牌')#进入商品品牌

firefox.find_element_by_partial_link_text('添加品牌').click() #添加品牌
firefox.find_element_by_id('brand_name').send_keys('苹果')
firefox.find_element_by_xpath('//button[contains(text(),"保存品牌")]').click()
time.sleep(3)

string=firefox.find_element_by_xpath('//table/tbody/tr[1]/td[1]').text
if '苹果' in string:
    writeLog('%s 测试通过'%testCase21)
else:
    writeLog('%s 测试不通过' % testCase21)
    getPhoto(firefox)


